//2487.从链表中移除节点
//https://leetcode.cn/problems/remove-nodes-from-linked-list/solutions/2587737/cong-lian-biao-zhong-yi-chu-jie-dian-by-z53sr/?envType=daily-question&envId=2024-01-03
class Solution {
public:
    ListNode* removeNodes(ListNode* head) {
        if( !head || !head->next) return head;
        head->next = removeNodes(head->next);
        if(head->val < head->next->val) return head->next;
        return head;
    }
};

